import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    component: () => import('@/views/Login/index.vue'),
  },
  {
    path: '/',
    component: () => import('@/views/Main/index.vue'),
    redirect: '/login',
    children: [
      {
        path: '/home',
        component: () => import('@/views/Home/index.vue'),
      },
      {
        path: '/company', // 0为未审核 1为审核
        component: () => import('@/views/Company/index.vue'),
      },
      {
        path: '/company/detail', 
        component: () => import('@/views/Company/detail.vue'),
      },
      {
        path: '/job',
        component: () => import('@/views/Job/index.vue'),
      },
      {
        path: '/job/add',
        component: () => import('@/views/Job/add.vue'),
      },
      {
        path: '/job/update',
        component: () => import('@/views/Job/update.vue'),
      },
      {
        path: '/recruit', // 0为未审核 1为审核
        component: () => import('@/views/Recruit/index.vue'),
      },
      {
        path: '/recruit/add',
        component: () => import('@/views/Recruit/add.vue'),
      },
      {
        path: '/notice',
        component: () => import('@/views/Notice/index.vue'),
      },
      {
        path: '/notice/add',
        component: () => import('@/views/Notice/add.vue'),
      },
      {
        path: '/notice/update',
        component: () => import('@/views/Notice/update.vue'),
      },
      {
        path: '/message',
        component: () => import('@/views/Message/index.vue'),
      },
      {
        path: '/message/getone',
        component: () => import('@/views/Message/getOne.vue'),
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
